package _1ChapterOne._8ReplaceMethodWithMethodObject;

public class Account {
    // 代码没有任何实际意义
    public int gammaOld(int inputVal, int quantity, int yearToDate) {
        int importantValue1 = (inputVal * quantity) + delta();
        int importantValue2 = (inputVal * yearToDate) + 100;
        if ((yearToDate - importantValue1) > 200) {
            importantValue2 -= 20;
        }
        int importantValue3 = importantValue2 * 7;
        // and so on
        return importantValue3 - 2 * importantValue1;
    }

    public int delta() {
        return 0;
    }

    public int gammaNew(int inputVal, int quantity, int yearToDate) {
        return new Gamma(this, inputVal, quantity, yearToDate).compute();
    }
}
